1. Field of the Invention
The present invention relates to interprocess communication and in particular to Java inter-applet communication for applets in different HTML frames.
2. Discussion of Related Art
In distributed computing environments, processes communicate with one another using various inter-process communication (IPC) standards. Processes, as used herein, refers to both user processes (application programs) and system processes. IPC communication standards generally utilize a technique referred to as xe2x80x9csocketsxe2x80x9d to communicate between cooperating processes. A first process establishes a socket by identifying the protocols to be used and the destination process with which it wishes to communicate. The second process also establishes a socket identifying the protocol supported for communicating with other processes. The second process then listens for another process to establish communications directed to its (the second process) address.
Java is a computer programming language recently gaining popularity for development of portable application programs. Java is an interpreted computer programming language. An interpreted computer programming language is one which does not directly translate into binary executable code. Rather, the source language (or an intermediate binary representation thereof) is processed by a program, an interpreter, which performs appropriate functions to implement the high-level source language statement. Interpreted languages such as Java are therefore often restricted in their functionality. Such restrictions are often considered desirable to enhance security measures within a system.
In particular, Java is frequently used for implementing so-called applets operable in the World Wide Web/Internet distributed computing environments. In such environments, a Web browser (client) downloads information from an identified Web server. The information, typically referred to as a page, may include Java applets to be downloaded to the Web browser. The Web browser includes a Java language interpreter which then interprets the downloaded applets to perform the desired task.
The Java specification generally precludes objects such as Java applets within one xe2x80x9cpagexe2x80x9d from communicating with objects in a second xe2x80x9cpagexe2x80x9d. Further, in the Java specification, a single displayed screen in the users Web browser may include a number of frames (distinct sections of information displayed for the user). A frame is generally considered the equivalent of a page with regard to the security measures of the Java specification which preclude objects communicating between pages or frames. It is therefore a problem in the Java language to communicate between applets.
Though applets in different frames in the Java language are not generally permitted to communicate with other applets using IPC sockets, they are permitted to communicate with processes on the server from which the Java applets were loaded. One solution to the inter-applet communication problems noted above has been for applets desiring communication to use a particular messenger service on the server from which the applets were loaded. Each applet is able to communicate with the messenger service on the server from which they were loaded. Therefore, the applets may communicate with one another via the messenger service as an intermediary.
This solution is incomplete and cumbersome. Furthermore, evolving standards in the Java language specification may preclude such communication links even with the server processes. First, the prior solutions are cumbersome in that both applets must communicate with the server process to effectuate their inter-applet communications. This utilizes valuable bandwidth where the communication links are slow or otherwise limited. The solutions are incomplete in the sense that only applets downloaded from a common server may communicate using these prior techniques.
Another prior solution has been to utilize the Javascript language as in intermediary between two applets desiring to communicate. The Java applets invoke functions in Javascript to effectuate other desired inter-applet communication. However, this solution is not standardized and may be supported only on the Netscape Communicator product. Older Web browsers and Microsoft Internet Explorer are incapable of implementing the solution.
It is evident from the above discussion that a need exists for improved inter-applet communications in the Java programming language.
The present invention solved the above and other problems, thereby advancing the state of the useful arts, by providing and inter-applet communication capability which is portable to a number of Web browsers, within standard Java language specifications, and less cumbersome in use of bandwidth than prior solutions. In particular, the present invention provides for defining a superclass common to all applets needing to communicate with each other. All applets desiring to so communicate are defined as subclasses of the superclass. The superclass has static variables defined therein and methods for notifying applets of changes in those static variables. The static variables are therefore useful for inter-applet communication purposes.
As compared to prior techniques no communication bandwidth need be utilized to communicate between applets in different frames of a Web browser. More specifically, a server based messenger process is not required for inter-applet communications in accordance with the present invention. Further, defining applets in accordance with the superclass of the present invention is within the standards prescribed for the Java programming language. The present invention is therefore more portable to a variety of Java implementations and associated Web browsers as compared to prior techniques.